#include "stdafx.h"
#include "IppUtils.h"

/*static*/int IppUtils::CalcOrder(uint32_t x)
{
	switch (x)
	{
	case 0x1:
		return 0;
	case 0x2:
		return 1;
	case 0x4:
		return 2;
	case 0x8:
		return 3;
	case 0x10:
		return 4;
	case 0x20:
		return 5;
	case 0x40:
		return 6;
	case 0x80:
		return 7;
	case 0x100:
		return 8;
	case 0x200:
		return 9;
	case 0x400:
		return 10;
	case 0x800:
		return 11;
	case 0x1000:
		return 12;
	case 0x2000:
		return 13;
	case 0x4000:
		return 14;
	case 0x8000:
		return 15;
	case 0x10000:
		return 16;
	case 0x20000:
		return 17;
	case 0x40000:
		return 18;
	case 0x80000:
		return 19;
	case 0x100000:
		return 20;
	case 0x200000:
		return 21;
	case 0x400000:
		return 22;
	case 0x800000:
		return 23;
	case 0x1000000:
		return 24;
	}

	return -1;
}